import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from "@/views/Home.vue";
import Share from "@/views/Share.vue";
import Tutorials from "@/views/Tutorials.vue";
import Signup from "@/views/Signup.vue";
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'home',
    component: Home
  },
  {
    path: '/Share',
    name: 'share',
    component: Share
  },
  {
    path: '/personal-center',
    name: 'personal-center',
    component: () => import('../views/PersonalCenter/PersonalCenter.vue'),
    redirect: '/person-profile',
    children: [
      {
        path: "/person-profile",
        component: () => import("../views/PersonalCenter/PersonProfile.vue")
      },
      {
        path: "/my-favorites",
        component: () => import("../views/PersonalCenter/MyFavorites.vue")
      },
      {
        path: "/my-concerns",
        component: () => import("../views/PersonalCenter/MyConcerns.vue")
      }
    ]

    // meta: { requireLogin: true }
  }, {
    path: '/Details',
    name: 'Details',
    component: () => import('../views/Details.vue'),
    // meta: { requireLogin: false }


  }, {
    path: '/Login',
    name: 'Login',
    component: () => import('../views/Login.vue'),
  }, {
    path: '/Tutorials',
    name: 'tutorials',
    component: Tutorials,
    // meta: { requireLogin: true }
  },{
    path: '/Signup',
    name: 'Signup',
    component: Signup,
    // meta: { requireLogin: true }
  },


]

const router = new VueRouter({
  mode: "history",//去掉#
  routes
})

export default router
